tested final code -- alpha (without documentation)