Added finishing touches and some bug fixes