bug fixes, working build