fixed bugs, works now