messy
using branches