better logic