Finished changes to the code. Sort of beta version.