fixed duplication bug, now duplicates correctly
better organization
toggle type works now