use prototypes and other details
cleanup
cleanup
optimizations