partial building optimization

really difficult