added ability to edit own profile. and some code style improvements