working order, fixed bugs