pracovna verzia: nearly complete, minor features missing