Implemented first round of type calculations