minor code fixes and added methods