Initial implementation of Cost