Many functions amaned and some new ones added.