updated to fix bugs
merged