updated for fixed bugs