Added comments and a bit of cleaning up

Signed-off-by: Jacky Boen <aqiank@gmail.com>