finally figured out the errors!