Credits: Some code of this HW is taken from Google Public Repos.