fixed some last minute bugs of importance