fixed bugs, now runs