Fixed errors and began rearchitecture