Attempt 1

Functions written based on vector cacheing example