bisic function completed
version 1
version 2