Added first bit of logic