finished the the complete implementation, still need a little bit of
refactoring...