finished most functions
finished