updated comments and removed some un used code