Added basic JS algorithm for calculating roof sizes