fixed bugs, improved build