corrected errors
everything seems to work, merging