Beta version

Please, don't judge strictly, I will add more comments later.
Did I write all necessary functions?