optimized code
added support of new timply format