updated functions and style