Added comments and renamed some variable to follow android code style conventions