code enhance, small fixes, added features