Changed organization, fixed bugs