Fixed bugs - now it kidn of works