Added 1st version of building script + code clean-up