commented and cleaned up a code a bit