finished core fucntionality