updated comments and general structure