added substring method
refactored method names