first half code written