deleted unused functions, organized, commented