First attempt at merging the two