formating and small bug fixes
formating and building finish function