Change build method based on work done by Nicholas K. Dionysopoulos