implementation: finished first version