remove debugging, adds comments, removes on unsed function