revamp structure, add math