cleaned up, commented finished funcs