updated almost every function