lyy - implement major function