random bug fixes… first working version!