improved comments, cleaned up some useless code