added instructions, comments and moved some code arround to better places