port existing code
Merge pull request #1 from fariza/existing-code

port existing code