Version submitted for MSc dissertation.