Final code finished for version 1.