Fixed several bugs and implemented enhanchements (Issues #1 - #6)