Added Teglalap implementation