Added code from previous prototypes