Some make changes and some helper functions added.