Some functions was implemented. Some code is fixed.